package com.wrk._3_方法._01_课件;

public class _006_判断是否存在 {
    public static void main(String[] args) {
        //定义数组
        int [] arrays = {11,33,22,44,55};
        //给数组传值并调用输出
        boolean cc = aaa(arrays,22);
        System.out.println(cc);
    }

    //定义一个方法，进行数组判断,既然是判断，则确定了返回值是true false
    public static boolean aaa(int[] ary,int number){
        for (int i = 0; i < ary.length; i++) {
            if (ary[i] == number){
                return true;
            }
        }
        return false;
    }
}
